<template>
    <div class="contentDetail">
        <IHeader class="header" back="true" title="内容详情"></IHeader>
        <scroller>
           <div class="wrap">
               <text class="contentTitle">{{contentDetail.title}}</text>
               <div class="fabutime">
                   <text class="timeText">发布时间： {{contentDetail.createTime}}</text>
                   <text class="yellowText" >#{{zixuntext}}</text>
               </div>
               <div class="mainCon" v-if="contentDetail.text">
                   <Html :inner="contentDetail.text"></Html>
               </div>
               <!--<div class="mainCon" v-for="(item, index) in contentDetail.text" :key="index" :class="[index === contentDetail.text.length - 1 ? 'lastMargin' : '']">-->
                   <!--<text class="contentText">{{item.text}}</text>-->
                   <!--<image v-if="item.pic && item.pic.length > 0" :src="item.pic" class="goodImg"></image>-->
               <!--</div>-->
           </div>
        </scroller>
        <wxc-loading :show="loadingShow" :need-mask="needMask"></wxc-loading>
    </div>
</template>
<script>
import IHeader from '@/components/header'
import {fanhallCon} from '@/api/fanhall'
import {getInfo} from '@/api/good'
import Html from '@/components/html'
import { WxcLoading } from 'weex-ui'
// const modal = weex.requireModule('modal')
export default {
  name: 'contentDetail',
  data () {
    return {
      id: '',
      zixuntext: '',
      contentDetail: [],
      needMask: true, // 显示蒙版
      loadingShow: true // loading
    }
  },
  mounted: function () {
    const that = this
    that.id = that.$route.query.id
    that.loadingShow = true
    that.$api.get(fanhallCon + '/' + that.id, {}, function (res) {
      that.contentDetail = res.data
      that.loadingShow = false
      let getInfoparams = {
        type: 'information_type',
        value: that.contentDetail.informationType
      }
      that.$api.get(getInfo, getInfoparams, function (res1) {
        that.zixuntext = res1.data.description
      })
    }, function () {
      that.loadingShow = false
    })
  },
  components: {
    IHeader,
    Html,
    WxcLoading
  }
}
</script>

<style scoped>
.wrap{
    padding-top: 23px;
    padding-left: 25px;
    padding-right: 25px;
    padding-bottom: 30px;
    margin-top: 88px;
}
.fabutime{
    flex-direction: row;
    justify-content: space-between;
    margin-top: 14px;
    margin-bottom:10px;
}
.timeText{
    color: rgb(206,206,206);
    font-weight: bold;
    font-size: 22px;
}
.yellowText{
    font-size:22px;
    color:rgb(243,203,1);
    font-weight:bold;
}
    .goodImg{
        width:700px;
        height:435px;
        margin-top:20px;
        margin-bottom:20px;

    }
    .contentText{
        font-size:30px;
        color:rgb(70,70,70)
    }
    .contentTitle{
        font-size: 30px;
        color:rgb(70,70,70);
        font-weight: bold
    }
.lastMargin{
    margin-bottom: 20px;
}
</style>
